home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.pro;
-
- import java.util.Vector;
- import symantec.itools.db.net.RemoteObject;
- import symantec.itools.db.net.TextParam;
- import symjava.sql.SQLException;
-
- public class ListBinder {
- private Vector _columns;
- private Vector _listProjections;
- private RelationView _listRV;
- private RelationView _parentRV;
- private ListLink _listObject;
- private RemoteObject _messgr;
- private Session _session;
- private ConnectionInfo _conn;
- private final int METHOD_getListRelView;
-
- ListBinder(RelationView parRV, int id, Vector colIds, ListLink listObject, Session session, ConnectionInfo conn) throws SQLException {
- this._parentRV = parRV;
- this._columns = colIds;
- this._listObject = listObject;
- this._listRV = null;
- this._session = session;
- this._conn = conn;
- this._messgr = new RemoteObject("ProxyListView", id, this._session.getClientSession());
- this._listProjections = new Vector();
-
- for(int index = 0; index < this._columns.size(); ++index) {
- ListProjection lp = new ListProjection(this);
- Integer temp = (Integer)this._columns.elementAt(index);
- this._listProjections.addElement(lp);
- this._parentRV.bindProj(temp, lp);
- }
-
- this.dataChanged();
- this._listObject.init(this);
- }
-
- public RelationView getRelationView() {
- return this._listRV;
- }
-
- void dataChanged() throws SQLException {
- Vector params = new Vector();
-
- for(int index = 1; index <= this._columns.size(); ++index) {
- params.addElement(new TextParam(1, ((ListProjection)this._listProjections.elementAt(index - 1)).getString()));
- }
-
- Vector results = this._messgr.invokeMethod(0, params);
- MultiView mv = new MultiView(this._session, results, this._conn);
- this._session.addMultiView(mv);
- if (this._listRV != null) {
- this._listRV.closeMultiView();
- }
-
- this._listRV = mv.getRootRelView();
- this._listObject.notifyListChange(this);
- }
- }
-